/****************************************************************************
**
** DCOP Skeleton created by dcopidl2cpp from kstarsinterface.kidl
**
** WARNING! All changes made in this file will be lost!
**
*****************************************************************************/

#include "./kstarsinterface.h"

#include <kdatastream.h>


static const char* const KStarsInterface_ftable[6][3] = {
    { "ASYNC", "lookTowards(QString)", "lookTowards(QString direction)" },
    { "ASYNC", "zoomIn()", "zoomIn()" },
    { "ASYNC", "zoomOut()", "zoomOut()" },
    { "ASYNC", "setAltAz(double,double)", "setAltAz(double alt,double az)" },
    { "ASYNC", "setLocalTime(int,int,int,int,int,int)", "setLocalTime(int yr,int mth,int day,int hr,int min,int sec)" },
    { 0, 0, 0 }
};

bool KStarsInterface::process(const QCString &fun, const QByteArray &data, QCString& replyType, QByteArray &replyData)
{
    if ( fun == KStarsInterface_ftable[0][1] ) { // void lookTowards(QString)
	QString arg0;
	QDataStream arg( data, IO_ReadOnly );
	arg >> arg0;
	replyType = KStarsInterface_ftable[0][0]; 
	lookTowards(arg0 );
    } else if ( fun == KStarsInterface_ftable[1][1] ) { // void zoomIn()
	replyType = KStarsInterface_ftable[1][0]; 
	zoomIn( );
    } else if ( fun == KStarsInterface_ftable[2][1] ) { // void zoomOut()
	replyType = KStarsInterface_ftable[2][0]; 
	zoomOut( );
    } else if ( fun == KStarsInterface_ftable[3][1] ) { // void setAltAz(double,double)
	double arg0;
	double arg1;
	QDataStream arg( data, IO_ReadOnly );
	arg >> arg0;
	arg >> arg1;
	replyType = KStarsInterface_ftable[3][0]; 
	setAltAz(arg0, arg1 );
    } else if ( fun == KStarsInterface_ftable[4][1] ) { // void setLocalTime(int,int,int,int,int,int)
	int arg0;
	int arg1;
	int arg2;
	int arg3;
	int arg4;
	int arg5;
	QDataStream arg( data, IO_ReadOnly );
	arg >> arg0;
	arg >> arg1;
	arg >> arg2;
	arg >> arg3;
	arg >> arg4;
	arg >> arg5;
	replyType = KStarsInterface_ftable[4][0]; 
	setLocalTime(arg0, arg1, arg2, arg3, arg4, arg5 );
    } else {
	return DCOPObject::process( fun, data, replyType, replyData );
    }
    return TRUE;
}

QCStringList KStarsInterface::interfaces()
{
    QCStringList ifaces = DCOPObject::interfaces();
    ifaces += "KStarsInterface";
    return ifaces;
}

QCStringList KStarsInterface::functions()
{
    QCStringList funcs = DCOPObject::functions();
    for ( int i = 0; KStarsInterface_ftable[i][2]; i++ ) {
	QCString func = KStarsInterface_ftable[i][0];
	func += ' ';
	func += KStarsInterface_ftable[i][2];
	funcs << func;
    }
    return funcs;
}


